<?php

namespace app\company\validate;


class WarehouseValidate extends BaseValidate
{
    public function __construct()
    {
        $rule = [
            'name'      => 'require|max:50',
            'address'   => 'require|max:100',
            "real_name" => "require|max:50",
            "mobile"    => "require|mobile",
        ];

        $message = [
            "name.require"      => "仓库名称不能为空",
            "name.max"          => "仓库名称长度不能超过50个字符",
            "address.require"   => "仓库地址不能为空",
            "address.max"       => "仓库地址长度不能超过100个字符",
            "real_name.require" => "联系人不能为空",
            "real_name.max"     => "联系人长度不能超过50个字符",
            "mobile.require"    => "手机号不能为空",
            "mobile.mobile"      => "手机号格式错误",
        ];

        $scene = [
            'add'  => ['name', 'address', 'real_name', 'mobile'],
        ];
        parent::__construct($rule, $message, $scene);
    }
}